API Documentation
TreeReader.h
1 // TreeReader.h
3 //
5 
6 namespace nkExport
7 {
35  class TreeReader final
36  {
37  public :
38 
39  // Constructor, destructor
47  TreeReader (const TreeReader&) = delete ;
53  TreeReader (TreeReader&& other) ;
58 
59  // Controls
68  void addBool (bool& target, nkMemory::StringView path) ;
77  void addInt (int& target, nkMemory::StringView path) ;
86  void addUint (unsigned int& target, nkMemory::StringView path) ;
95  void addFloat (float& target, nkMemory::StringView path) ;
105 
117  template <typename T>
118  void addVector (nkMemory::BufferCast<T>& target, std::function<T (nkExport::Node*)> entryFiller, nkMemory::StringView path) ;
119 
131  template <typename T>
132  void addVector (std::vector<T>& target, std::function<T (nkExport::Node*)> entryFiller, nkMemory::StringView path) ;
133 
142  template <typename T = std::string>
143  void addString (std::string& target, nkMemory::StringView path) ;
144 
145  // Filling
151  void fill (nkExport::Node* tree) ;
152 
153  // Operators
157  TreeReader& operator= (const TreeReader&) = delete ;
164  } ;
165 }
nkExport::TreeReader::addInt
void addInt(int &target, nkMemory::StringView path)
nkExport::TreeReader::~TreeReader
~TreeReader()
nkExport::TreeReader::addBool
void addBool(bool &target, nkMemory::StringView path)
nkExport::TreeReader::addUint
void addUint(unsigned int &target, nkMemory::StringView path)
nkExport
Encompasses all API of component NilkinsExport.
Definition: Base64Encoder.h:7
nkExport::TreeReader::addVector
void addVector(std::vector< T > &target, std::function< T(nkExport::Node *)> entryFiller, nkMemory::StringView path)
nkExport::TreeReader::TreeReader
TreeReader()
nkExport::TreeReader::addString
void addString(nkMemory::String &target, nkMemory::StringView path)
nkExport::TreeReader::addFloat
void addFloat(float &target, nkMemory::StringView path)
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkExport::TreeReader
Utility class providing an easier way to parse trees.
Definition: TreeReader.h:36
nkExport::TreeReader::operator=
TreeReader & operator=(const TreeReader &)=delete
nkMemory::String
Class holding information about a string, with ownership over the data.
Definition: String.h:22
nkExport::TreeReader::addVector
void addVector(nkMemory::BufferCast< T > &target, std::function< T(nkExport::Node *)> entryFiller, nkMemory::StringView path)
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkMemory::BufferCast
Holds a Buffer and make it easy to cast the binary data.
Definition: BufferCast.h:18
nkExport::TreeReader::fill
void fill(nkExport::Node *tree)
nkExport::TreeReader::TreeReader
TreeReader(TreeReader &&other)
nkExport::TreeReader::addString
void addString(std::string &target, nkMemory::StringView path)
nkExport::TreeReader::TreeReader
TreeReader(const TreeReader &)=delete